using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using IPTV.service;
using IPTV.module;
using IPTV.util;
using Microsoft.TV.TVControls;
using Microsoft.TV.TVControls.Actions;


public partial class primaryIndex_page : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        UserService userService = new UserService();
        me_tgsg_user user = userService.userLogin();
        GradeService gService = new GradeService();
        string gid = gService.getGradeId("小学");
        Session[CommonUtil.SESSION_GRADE_ID] = gid;
        Session[CommonUtil.SESSION_USER] = user;
        string url = Request.Url.AbsolutePath;
        userService.logUserView(user, url, CommonUtil.LOGIN, null, gid, null);

        PrimaryIndexService primaryIndexService = new PrimaryIndexService();

        me_p_recommend_config pic1 = primaryIndexService.getAdPic("CK_TGSG_HOMEPAGE_AD_01");
        me_p_recommend_config pic2 = primaryIndexService.getAdPic("CK_TGSG_HOMEPAGE_AD_02");
        me_p_recommend_config pic3 = primaryIndexService.getAdPic("CK_TGSG_HOMEPAGE_AD_03");
        me_p_recommend_config pic4 = primaryIndexService.getAdPic("CK_TGSG_HOMEPAGE_AD_04");
        me_p_recommend_config pic5 = primaryIndexService.getAdPic("CK_TGSG_HOMEPAGE_AD_05");

        btn8.Background.ImagePath = pic1.Picture;
        btn8.FocusBackground.ImagePath = pic1.Picture;
        NavigateAction toZtDetail1 = (NavigateAction)TVActions1.Actions[7];
        toZtDetail1.Data = pic1.Linkrule + "?zhztinfoid=" + pic1.Entity_id + "&subject=" + pic1.Entity_subject + "&headLine=" + pic1.Title;

        btn9.Background.ImagePath = pic2.Picture;
        btn9.FocusBackground.ImagePath = pic2.Picture;
        NavigateAction toZtDetail2 = (NavigateAction)TVActions1.Actions[8];
        toZtDetail2.Data = pic2.Linkrule + "?zhztinfoid=" + pic2.Entity_id + "&subject=" + pic2.Entity_subject + "&headLine=" + pic2.Title;

        btn10.Background.ImagePath = pic3.Picture;
        btn10.FocusBackground.ImagePath = pic3.Picture;
        NavigateAction toZtDetail3 = (NavigateAction)TVActions1.Actions[9];
        toZtDetail3.Data = pic3.Linkrule + "?zhztinfoid=" + pic3.Entity_id + "&subject=" + pic3.Entity_subject + "&headLine=" + pic3.Title;

        btn11.Background.ImagePath = pic4.Picture;
        btn11.FocusBackground.ImagePath = pic4.Picture;
        NavigateAction toZtDetail4 = (NavigateAction)TVActions1.Actions[10];
        toZtDetail4.Data = pic4.Linkrule + "?zhztinfoid=" + pic4.Entity_id + "&subject=" + pic4.Entity_subject + "&headLine=" + pic4.Title;

        btn12.Background.ImagePath = pic5.Picture;
        btn12.FocusBackground.ImagePath = pic5.Picture;
        NavigateAction toZtDetail5 = (NavigateAction)TVActions1.Actions[11];
        toZtDetail5.Data = pic5.Linkrule + "?zhztinfoid=" + pic5.Entity_id + "&subject=" + pic5.Entity_subject + "&headLine=" + pic5.Title;

    }
}
